package com.yuandengta.yomall.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yuandengta.common.to.mq.SeckillOrderTO;
import com.yuandengta.common.utils.PageUtils;
import com.yuandengta.yomall.order.entity.OrderEntity;
import com.yuandengta.yomall.order.vo.OrderConfirmVO;
import com.yuandengta.yomall.order.vo.OrderSubmitResponseVO;
import com.yuandengta.yomall.order.vo.OrderSubmitVO;
import com.yuandengta.yomall.order.vo.PayVO;

import java.util.Map;

/**
 * 订单
 *
 * @author kevin
 * @email 178676392@qq.com
 * @date 2020-12-20 20:30:07
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 返回订单确认页需要的数据
     * @return
     * @throws Exception
     */
    OrderConfirmVO confirmOrder() throws Exception;

    /**
     * 下单操作
     * @param vo
     * @return
     */
    OrderSubmitResponseVO submitOrder(OrderSubmitVO vo);

    /**
     * 查询订单
     * @param orderSn 订单号
     * @return
     */
    OrderEntity getOrderByOrderSn(String orderSn);

    /**
     * 关闭订单
     * @param entity
     */
    void closeOrder(OrderEntity entity);

    /**
     * 获取订单支付信息
     * @param orderSn
     * @return
     */
    PayVO getOrderPay(String orderSn);

    /**
     * 查询当前登录会员所有订单信息
     * @return
     */
    PageUtils queryPageWithItem(Map<String, Object> params);

    /**
     * 修改订单状态
     * @param outTradeNo 订单号
     * @param status 订单状态
     */
    void updateOrderStatus(String outTradeNo, Integer status);

    /**
     * 创建秒杀订单
     * @param seckillOrder
     */
    void createSeckillOrder(SeckillOrderTO seckillOrder);
}

